package lsl.leetCode.year2023.test0206;

/**
 * 509.斐波那契数
 *
 * @author Zed
 * @description
 * @date 2023/2/6 19:31
 */
public class test509 {
    public static void main(String[] args) {
        System.out.println(fib(8));
    }

    public static int fib(int n) {
        return fibSum(n);
    }

    public static int fibSum(int n) {
        if (n == 0) {
            return 0;
        }
        if (n == 1) {
            return 1;
        }
        return fibSum(n-1) + fibSum(n - 2);
    }
}
